package adapter;

import android.support.annotation.Nullable;
import android.view.View;
import bean.DispatchRiderBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dispatchapp.andlei.R;

import java.util.List;

public class DispatchRiderAdapter extends BaseQuickAdapter<DispatchRiderBean, BaseViewHolder> {
    public DispatchRiderAdapter(int layoutResId, @Nullable List<DispatchRiderBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, DispatchRiderBean item) {
        if(item.isSelect()){
            helper.getView(R.id.img_gou).setVisibility(View.VISIBLE);
        }else {
            helper.getView(R.id.img_gou).setVisibility(View.GONE);
        }
        helper.setText(R.id.tv_name,item.getNickname());
        helper.setText(R.id.tv_ordernum,"(已接单"+item.getNum()+")");
    }
}
